package com.sgb.kjwl.view.ui.adapter.pick;


import android.app.Activity;
import android.text.TextUtils;
import android.util.Log;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;
import androidx.core.util.Pair;
import androidx.lifecycle.MutableLiveData;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jyb.qiyefuwu.router.PathHome;
import com.sgb.alimaplibrary.util.ToastUtil;
import com.sgb.auction.activity.AuctionManageActivity;
import com.sgb.auction.activity.AuctionPublishActivity;
import com.sgb.auction.activity.BiddingQueryActivity;
import com.sgb.capital.view.ui.activity.CapitalActivity;
import com.sgb.goods.utils.Constants;
import com.sgb.jicai.view.activity.FactoryJicaiActivity;
import com.sgb.jicai.view.activity.JcChanceListActivity;
import com.sgb.jicai.view.activity.JcMyPriceActivity;
import com.sgb.jicai.view.activity.MyCenterMyJoinActivity;
import com.sgb.jicai.view.activity.MyCenterXuFangFaQiActivity;
import com.sgb.jicai.view.activity.MyJicaiSupervisionActivity;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.businessmanagement.CompanyEntity;
import com.sgb.kjwl.model.entity.self.PermissionMenuEntity;
import com.sgb.kjwl.utils.ActivityJump;
import com.sgb.kjwl.utils.DialogFunction;
import com.sgb.kjwl.view.ui.activity.EmptyNullActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.AddNeedListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.ContanctsActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.MakeOverPublishMainActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.MySignUpListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.ProfessionalTeamPictureActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.PublishServiceListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.ServiceQuoteListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.TalentListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.TeamIntelligenceListActivity;
import com.sgb.kjwl.view.ui.activity.enterprise.UserCenterTeamDetailActivity;
import com.sgb.kjwl.view.ui.activity.leaseAsk.MyAskLeaseActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebSiteAddressActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebSiteGroupActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteMyXiXinActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteOrganizationActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteQiYeXiXinActivity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteReleaseActivity;
import com.sgb.kjwl.view.ui.activity.pick.PickExpertListActivity;
import com.sgb.kjwl.view.ui.activity.self.ApprovalManagerActvity;
import com.sgb.kjwl.view.ui.activity.self.CarManagerActivity;
import com.sgb.kjwl.view.ui.activity.self.JoinCompanyActivity;
import com.sgb.kjwl.view.ui.activity.self.LogisticsMenuActivity;
import com.sgb.kjwl.view.ui.activity.self.PersonInfoActivity;
import com.sgb.kjwl.view.ui.activity.self.authentication.AuthActivity3;
import com.sgb.kjwl.view.ui.activity.self.authentication.CertificationActivity;
import com.sgb.kjwl.view.ui.activity.self.carMaster.BusinessOpportunitySubscriptionActivity;
import com.sgb.kjwl.view.ui.activity.self.carMaster.CarriageManageActivity;
import com.sgb.kjwl.view.ui.activity.self.carMaster.MyOfferActivity;
import com.sgb.kjwl.view.ui.activity.self.lease.LeaseMemberListActivity;
import com.sgb.kjwl.view.ui.activity.self.lease.SelfLeaseDemandListActivity;
import com.sgb.kjwl.view.ui.activity.self.lease.SelfLeaseOrderListActivity;
import com.sgb.kjwl.view.ui.activity.self.logistics.AddCarActivity;
import com.sgb.kjwl.view.ui.activity.self.logistics.BiddingOrderActivity;
import com.sgb.kjwl.view.ui.activity.self.logistics.CargoManageActivity;
import com.sgb.kjwl.view.ui.activity.self.logistics.PublishCargoActivity;
import com.sgb.kjwl.view.ui.activity.self.mine.IntelligentAttentionActivity;
import com.sgb.kjwl.view.ui.activity.self.mine.LetterBackActivity;
import com.sgb.kjwl.view.ui.activity.self.mine.MonitoringReportActivity;
import com.sgb.kjwl.view.ui.activity.self.offer.TruckRegisterActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.LaborServiceAndEmploymentPublishListActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfEmploymentApplyActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfPackersManageActivity2;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamAchieveActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamAlbumActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamDeviceActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamEmploymentActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamGroupActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamIntroduceEditActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamMembersActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfTeamOfferActivity;
import com.sgb.kjwl.view.ui.activity.self.packers.SelfWorkerPublishActivity;
import com.sgb.kjwl.view.ui.activity.self.publish.GoodsListActivity3;
import com.sgb.kjwl.view.ui.activity.self.publish.GoodsPublishActivity;
import com.sgb.kjwl.view.ui.activity.self.publish.PublicMyPriceListActivity;
import com.sgb.kjwl.view.ui.activity.self.publish.SelfLeaseListActivity;
import com.sgb.kjwl.view.ui.activity.self.team.TeamFunctionActivity;
import com.sgb.kjwl.view.ui.activity.transport.AddSelfCarActivity;
import com.sgb.kjwl.view.ui.activity.transport.MainCitiesActivity;
import com.sgb.kjwl.view.ui.activity.transport.OwnerAndDriverInquiryActivity;
import com.sgb.kjwl.view.ui.activity.transport.SelfCarManagerActivity;
import com.sgb.kjwl.view.ui.activity.transport.company.FleetManagementActivity;
import com.sgb.kjwl.view.ui.activity.transport.driver.order.TransportOrderDriverActivity;
import com.sgb.kjwl.view.ui.activity.transport.owner.FreightCarTransportationActivity;
import com.sgb.kjwl.view.ui.activity.transport.owner.TransportOrderOwnerActivity;
import com.sgb.kjwl.view.widget.self.MenuClickUtils;
import com.sgb.link.router.PathDriver;
import com.sgb.link.router.PathGoods;
import com.sgb.link.router.PathLogin;
import com.sgb.link.router.PathLogistics;
import com.sgb.link.router.PathMerchant;
import com.sgb.link.router.PathTeam;
import com.sgb.link.router.PathTrip;
import com.sgb.member.ui.activity.MemberAuditActivity;
import com.sgb.member.ui.activity.MemberClientManageActivity;
import com.sgb.member.ui.activity.MemberDoorActivity;
import com.sgb.member.ui.activity.MemberInviteOrApplyActivity;
import com.sgb.member.ui.activity.MemberLeverSettingActivity;
import com.sgb.member.ui.activity.MemberManageActivity;
import com.sgb.member.ui.activity.RatingBusinessActivity;
import com.sgb.member.ui.activity.RemoveMemberActivity;
import com.sgb.zhaocai.view.activity.PickInvitedApplyListActivity;
import com.sgb.zhaocai.view.demand.activity.DemandIssueListActivity;
import com.sgb.zhaocai.view.demand.activity.OfferQueryListActivity;
import com.sgb.zhaocai.view.demand.activity.ProjectIssueListActivity;
import com.swgk.core.base.model.entity.RouterKey;
import com.swgk.core.dialog.RoundDialog;
import com.swgk.core.event.EventConstant;
import com.swgk.core.util.ACAdminDialogUtils;
import com.swgk.core.util.MToast;
import com.swgk.core.util.SharedPreferenceUtil;
import com.swgk.core.util.UiUtil;
import com.swgk.core.util.UserOperating;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SecondMoreAdapter extends BaseQuickAdapter<PermissionMenuEntity, BaseViewHolder> {
    private SecondtwoMoreAdapter adapter;//二级菜单适配器
    private boolean isbianji=false;
    private onClickAddlistener clickAddlistener;
    private MutableLiveData<Map<String, String>> mediatorLiveData;
    private int mType;
    public SecondMoreAdapter(int layoutResId, @Nullable List<PermissionMenuEntity> data) {
        super(layoutResId, data);
    }
    public MutableLiveData<Map<String, String>> getMutableLiveData() {
        if (mediatorLiveData == null) {
            mediatorLiveData = new MutableLiveData();
        }
        return mediatorLiveData;
    }
    @Override
    protected void convert(BaseViewHolder helper, PermissionMenuEntity item) {
         helper.setText(R.id.title,item.getTitle());
         //一级列表
         RecyclerView recyclerView = helper.getView(R.id.mRecyclerView);
//         List<String> mlist =new ArrayList<>();
//         for (int i =0;i<4;i++){
//             mlist.add("招标管理");
//         }
         adapter =new SecondtwoMoreAdapter(R.layout.item_secondmore_two,item.getList());
         adapter.setisbianji(isbianji);
        LinearLayoutManager linearLayout =new LinearLayoutManager(mContext){
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        };
        recyclerView.setLayoutManager(linearLayout);
        recyclerView.setAdapter(adapter);
        adapter.setClickAddlistener(new SecondtwoMoreAdapter.onClickAddlistener() {
            @Override
            public void addlistener(int threepos, int twopos) {
                 clickAddlistener.addlistener(threepos,twopos,helper.getPosition());
            }

            @Override
            public void addItemlistener(int threepos, int twopos) {
                clickAddlistener.addItemlistener(threepos,twopos,helper.getPosition());
            }
        });
    }
    public void setisbianji(boolean isbiani){
          this.isbianji =isbiani;
          notifyDataSetChanged();
    }
  public   interface onClickAddlistener{
        void addlistener(int threepos,int twopos,int onepos);
        void addItemlistener(int threepos,int twopos,int onepos);
    }
    public void setClickAddlistener(onClickAddlistener clickAddlistener){
        this.clickAddlistener =clickAddlistener;
    }


}
